﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;

namespace anks.Lib.Classes
{
    public class Singleton<T> where T : class, new()
    {
        protected Singleton() { }

        private sealed class SingletonCreator<S> where S : class, new()
        {
            private static readonly S instance = new S();

            public static S CreatorInstance
            {
                get { return instance; }
            }
        }

        public static T Instance
        {
            get { return SingletonCreator<T>.CreatorInstance; }
        }

    }
}
